#ifndef VISUALKUKAROBOTBACKEND_H
#define VISUALKUKAROBOTBACKEND_H

#include <QObject>
#include <qtcpserver.h>
#include <qtcpsocket.h>

#include "_Interface/_datastruct.h"
#include "_Interface/_interface_backend.h"
#include "Package/kukarsiudpserverdll_global.h"
#include "Package/oxfordlasersensordll_global.h"
#include "Package/simpletcpsocketdll_global.h"
#include "Package/sriforcesensordll_global.h"
#include "Package/kukarsittsdll_global.h"

class visualkukarobotbackend : public BackendInterface{
public:
    visualkukarobotbackend();
    ~visualkukarobotbackend();

private:
    OxfordLaserSensorDLL* mOxfordLaserSensor;
    SRIForceSensorDLL* mSRIForceSensor;
    KuKaRsiTTSDLL* mKuKaRsiTTS;

public:
    short getKUKARIst(double (&KUKARIst)[6]);
    short getKUKAAIst(double (&KUKAAIst)[6]);
    short getKUKAATor(double (&KUKAATor)[6]);
    short setKUKARTTS(double KUKARTTS[6]);

    void  ForceSensorZeroDeal();
    short ReadForceSensorData(double (&Data)[6]);
    short ReadLaserSensorData(double (&Data)[8]);

    short KUKAProcess();

private:
    short KUKADataRecv();
    short KUKADataSend();

    short ForceSensorConnect();
    void  ForceSensorLoopRun();

    short LaserSensorConnect();
    void  LaserSensorLoopRun();
};

#endif // VISUALKUKAROBOTBACKEND_H
